Skip to content

Field: keep polarity on MagneticField re-initialisation - #15682

Merged
sawenzel merged 1 commit into
AliceO2Group:devfrom
sawenzel:fix-magfield-reload-polarity
Aug 17, 2026
Merged

Field: keep polarity on MagneticField re-initialisation#15682
sawenzel merged 1 commit into
AliceO2Group:devfrom
sawenzel:fix-magfield-reload-polarity

Conversation

@sawenzel

Copy link
Copy Markdown
Collaborator

This commit fixes MagneticField re-initialisation such that a field read back from a file keeps its polarity instead of being silently inverted. It:

  • applies the polarity convention once, in the constructors, instead of in CreateField()
  • leaves the stored factors untouched in CreateField(), which is the entry point for re-initialising a streamed object whose measured map is transient
  • adds a test comparing field vectors, not magnitudes, across a write/read round trip at solenoid, dipole and machine-compensator points

This makes it possible to write a configured field to a ROOT file and read it back unchanged; until now the only correct way to recreate a field was to rebuild it from the GRP currents.

This commit fixes MagneticField re-initialisation such that a field read back
from a file keeps its polarity instead of being silently inverted. It:
- applies the polarity convention once, in the constructors, instead of in
  CreateField()
- leaves the stored factors untouched in CreateField(), which is the entry point
  for re-initialising a streamed object whose measured map is transient
- adds a test comparing field vectors, not magnitudes, across a write/read round
  trip at solenoid, dipole and machine-compensator points

This makes it possible to write a configured field to a ROOT file and read it
back unchanged; until now the only correct way to recreate a field was to
rebuild it from the GRP currents.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0178JHAQ2biaX5ac9ThppBXi
@sawenzel
sawenzel requested a review from shahor02 as a code owner August 16, 2026 18:00
@sawenzel
sawenzel merged commit 885e4ea into AliceO2Group:dev Aug 17, 2026
11 checks passed
@sawenzel
sawenzel deleted the fix-magfield-reload-polarity branch August 17, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants